package cn.com.pajx.pajx_visitor_v3.room;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * create by ruancw on 2024/2/28
 * description 线程管理
 */
public class ExecutorManager {
    private static final int THREAD_COUNT = 3;
    private static ExecutorManager instance;
    private ExecutorService executorService;

    public ExecutorManager() {
        this.executorService = Executors.newFixedThreadPool(THREAD_COUNT);
    }

    public static ExecutorManager getInstance() {
        if (instance == null) {
            instance = new ExecutorManager();
        }
        return instance;
    }

    public ExecutorService getExecutorService() {
        return executorService;
    }

}
